<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="OcorrenciaCreateDlg" widgetVar="OcorrenciaCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.CreateOcorrenciaTitle}">
            <h:form id="OcorrenciaCreateForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{ocorrenciaController.selected != null}">
                        <p:outputLabel value="#{bundle.CreateOcorrenciaLabel_idOcorrencia}" for="idOcorrencia" />
                        <p:inputText id="idOcorrencia" value="#{ocorrenciaController.selected.idOcorrencia}" title="#{bundle.CreateOcorrenciaTitle_idOcorrencia}" required="true" requiredMessage="#{bundle.CreateOcorrenciaRequiredMessage_idOcorrencia}"/>
                        <p:outputLabel value="#{bundle.CreateOcorrenciaLabel_txOcorrencia}" for="txOcorrencia" />
                        <p:inputText id="txOcorrencia" value="#{ocorrenciaController.selected.txOcorrencia}" title="#{bundle.CreateOcorrenciaTitle_txOcorrencia}" required="true" requiredMessage="#{bundle.CreateOcorrenciaRequiredMessage_txOcorrencia}"/>
                        <p:outputLabel value="#{bundle.CreateOcorrenciaLabel_dtOcorrencia}" for="dtOcorrencia" />
                        <p:calendar id="dtOcorrencia" pattern="MM/dd/yyyy HH:mm:ss" value="#{ocorrenciaController.selected.dtOcorrencia}" title="#{bundle.EditOcorrenciaTitle_dtOcorrencia}"  showOn="button"/>
                        <p:outputLabel value="#{bundle.CreateOcorrenciaLabel_cdCadastrador}" for="cdCadastrador" />
                        <p:inputText id="cdCadastrador" value="#{ocorrenciaController.selected.cdCadastrador}" title="#{bundle.CreateOcorrenciaTitle_cdCadastrador}" />
                        <p:outputLabel value="#{bundle.CreateOcorrenciaLabel_codComprovanteEntrega}" for="codComprovanteEntrega" />
                        <p:selectOneMenu id="codComprovanteEntrega" value="#{ocorrenciaController.selected.codComprovanteEntrega}" >
                            <f:selectItems value="#{comprovanteEntregaController.itemsAvailableSelectOne}"
                                           var="codComprovanteEntregaItem"
                                           itemValue="#{codComprovanteEntregaItem}"/>
                        </p:selectOneMenu>
                        <p:outputLabel value="#{bundle.CreateOcorrenciaLabel_codContrato}" for="codContrato" />
                        <p:selectOneMenu id="codContrato" value="#{ocorrenciaController.selected.codContrato}" >
                            <f:selectItems value="#{contratoController.itemsAvailableSelectOne}"
                                           var="codContratoItem"
                                           itemValue="#{codContratoItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{ocorrenciaController.create}" value="#{bundle.Save}" update="display,:OcorrenciaListForm:datalist,:growl" oncomplete="handleSubmit(args,'OcorrenciaCreateDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="OcorrenciaCreateDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
